package com.ly.count.http;

import cn.hutool.core.lang.UUID;
import cn.hutool.core.lang.generator.UUIDGenerator;
import cn.hutool.core.util.IdUtil;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class CPlusResponse<T> implements Serializable {

   private int code;

   private String message;

   private String requestId;

   private T data;
    public CPlusResponse(CplusHttpStatus status) {
        this.code = status.getCode();
        this.message = status.getMessage();

        this.requestId = IdUtil.simpleUUID();
    }

    public CPlusResponse(T t ,CplusHttpStatus status) {
        this.code = status.getCode();
        this.message = status.getMessage();
        this.data = t;
        this.requestId = UUID.fastUUID().toString();
    }


}
